import { Tabs, TabItem } from '@aws-amplify/ui-react'; import { Example, ExampleCode } from '@/components/Example'; import { BasicShoppingCard, AdvancedShoppingCard } from '../shared'; import { InstallScripts, TerminalCommand } from '@/components/InstallScripts.tsx'; import { Fragment } from '@/components/Fragment'; ## Tutorial In this brief tutorial, we're going to build a basic shopping cart component using [Vite.js](https://vitejs.dev/) and Amplify UI. Then, we'll elaborate on our shopping card to play with the possibilities of using Amplify UI. ### Setup and Installation First, execute the command below in your terminal. When prompted for the name of your project, enter `amplify-ui-demo`. Also see [Vite Guide](https://vitejs.dev/guide/). #### npm 7+ **Next, install the Amplify UI React package:** **When working with a [Vite](https://vitejs.dev) project you must make a few modifications. Please follow the steps below.** {({ platform }) => import(`../../troubleshooting/shared/vite-polyfill.mdx`)} #### npm 7+ **Next, install the Amplify UI React package:** **When working with a [Vite](https://vitejs.dev) project you must make a few modifications. Please follow the steps below.** {({ platform }) => import(`../../troubleshooting/shared/vite-polyfill.mdx`)} {({ platform }) => import(`../../troubleshooting/shared/vite-polyfill-ts.mdx`)} > If you are still having issues, please see comments on the following issue for additional [Vite workarounds](https://github.com/aws-amplify/amplify-js/issues/9639). Note that there is active ongoing work to make these modifications unnecessary. ### Basic Demo Open up the project in your IDE and delete the contents of the `index.css` file. Next, replace the contents of the `App.jsx` or `App.tsx` file with the code below: ```tsx file=./examples/BasicExampleCode.tsx ``` Now start the app by running `npm run dev` and you should see a basic shopping card component. ### Advanced Demo If you’d like to play around with a more comprehensive demo of the Amplify UI library, create a separate file under the `pages` folder named `paintings.js`, and copy/paste this code into it: ```tsx file=./examples/paintings.ts ``` Then, replace the contents of `App.jsx` or `App.tsx` with the code below, restart the app, and experience all the beautiful components in action! ```tsx file=./examples/AdvancedExampleCode.tsx ```